package com.linsir.lin.controller;

import com.linsir.lin.dto.GridDTO;
import com.linsir.lin.pojo.SysMenu;
import com.linsir.lin.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

@RestController
@RequestMapping(value = "/menu")
public class SysMenuController {

    @Autowired
    private SysMenuService sysMenuService;


    @RequestMapping(value = "/init")
    public Map<String,Object> menuInit()
    {
        return sysMenuService.initData();
    }

    @RequestMapping(value = "/grid",method = {RequestMethod.GET,RequestMethod.POST})
    public GridDTO<SysMenu> grid() throws IOException {
        return sysMenuService.grid();
    }

}
